package mysql

import "gorm.io/gorm"

type Goods struct {
	gorm.Model
	GoodsName  string  `gorm:"type:varchar(30);not null"`
	GoodsPrice float32 `gorm:"type:decimal(10,2);not null"`
	GoodsImage string  `gorm:"type:varchar(500);not null"`
	Stock      int64   `gorm:"type:int(11);not null"`
	UserId     int64   `gorm:"type:int(11);not null"`
}

func (g *Goods) GoodsAdd(db *gorm.DB) error {
	return db.Debug().Create(g).Error
}
